<template>
	<view>
		<stop isBack>
			<view slot="content">创建总结计划</view>
		</stop>
		<view class="mart3 bcf pad5">
			<view class="tac pad5 bdda pos-r" @tap="goto('/pages/ciming/report/create_form')">
				创建日志
				<ripple></ripple>
			</view>
		</view>
		<view class="mart3 bcf padlr2 padt1">
			<view class="list-style-2 mart2">正在编辑的项目</view>
			<view class="">
				<stab :names="['每日','每周','每月']" center v-model="myCurTab"></stab>
			</view>
			<view v-show="myCurTab == 0">
				<view class="bdso mart3 round3 ofh pos-r" v-for="item in dayLog" :key="item.id" @tap="goto('/pages/ciming/report/create_form?id=' + item.id)">
					<view class="bc13 c12 pad2 flrc">
						<view class="flex1 c11">{{datetime(item.createAt)}}</view>
						<view class="c11 fs10">{{item.type.name}}</view>
					</view>
					<!-- 总结 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">总结</view>
						<view v-for="row,index in item.summary" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.summary.length == 0">内容未填写</view>
					</view>
					<!-- 计划 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">计划</view>
						<view v-for="row,index in item.plan" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.plan.length == 0">内容未填写</view>
					</view>
					<ripple></ripple>
				</view>
			</view>
			
			<view v-show="myCurTab == 1">
				<view class="bdso mart3 round3 ofh pos-r" v-for="item in weekLog" :key="item.id" @tap="goto('/pages/ciming/report/create_form?id=' + item.id)">
					<view class="bc13 c12 pad2 flrc">
						<view class="flex1 c11">{{datetime(item.createAt)}}</view>
						<view class="c11 fs10">{{item.type.name}}</view>
					</view>
					<!-- 总结 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">总结</view>
						<view v-for="row,index in item.summary" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.summary.length == 0">内容未填写</view>
					</view>
					<!-- 计划 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">计划</view>
						<view v-for="row,index in item.plan" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.plan.length == 0">内容未填写</view>
					</view>
					<ripple></ripple>
				</view>
			</view>
			
			<view v-show="myCurTab == 2">
				<view class="bdso mart3 round3 ofh pos-r" v-for="item in monthLog" :key="item.id" @tap="goto('/pages/ciming/report/create_form?id=' + item.id)">
					<view class="bc13 c12 pad2 flrc">
						<view class="flex1 c11">{{datetime(item.createAt)}}</view>
						<view class="c11 fs10">{{item.type.name}}</view>
					</view>
					<!-- 总结 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">总结</view>
						<view v-for="row,index in item.summary" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.summary.length == 0">内容未填写</view>
					</view>
					<!-- 计划 -->
					<view class="mart3 padl3">
						<view class="list-style-2 fwb">计划</view>
						<view v-for="row,index in item.plan" class="flex-r flex-start pad2 pos-r">
							<text class="fwb wh10-10 flcc bg-black">{{index+1}}.</text>
							<view>
								<view class="padl2">进度：{{row[1]}}</view>
								<view class="padl2">内容：{{row[0]}}</view>
							</view>
						</view>
						<view class="mar2 pad3 bdso tac" v-show="item.plan.length == 0">内容未填写</view>
					</view>
					<ripple></ripple>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dayLog:[],
				weekLog:[],
				monthLog:[],
			}
		},
		methods: {
		},
		onLoad() {
			
		},
		onShow() {
			this.$api.get('/api/cur/cimingReports',{
				_g:['report']
			},res=>{
				this.log(res)
				this.dayLog = res.d.day
				this.weekLog = res.d.week
				this.monthLog = res.d.month
			})
		}
	}
</script>

<style>

</style>
